GtkStack: Fix double-draw in crossfade
authorAlexander Larsson <alexl@redhat.com>
Tue, 7 May 2013 07:28:30 +0000 (09:28 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 7 May 2013 14:40:24 +0000 (16:40 +0200)
We should only draw the cross-fade on the bin window, not doing this
was causing us to draw it multiple times using ADD which resulted
in weird colors.

gtk/gtkstack.c

index 3d65265802297ecb59dc9c66db4b09fa68660a6a..e890610d4311599c51968b23d020f1fac531749a 100644 (file)
@@ -1437,7 +1437,8 @@ gtk_stack_draw (GtkWidget *widget,
   GtkStackPrivate *priv = stack->priv;
   cairo_t *pattern_cr;
 
-  if (priv->visible_child)
+  if (priv->visible_child &&
+      gtk_cairo_should_draw_window (cr, priv->bin_window))
     {
       if (priv->transition_pos < 1.0)
         {
@@ -1475,7 +1476,7 @@ gtk_stack_draw (GtkWidget *widget,
             }
 
         }
-      else if (gtk_cairo_should_draw_window (cr, priv->bin_window))
+      else
         gtk_container_propagate_draw (GTK_CONTAINER (stack),
                                       priv->visible_child->widget,
                                       cr);